<template>
<div class="header">
    <mt-header :title="title">
        <router-link v-if="back" to="" slot="left">
            <mt-button icon="back" @click="goback"></mt-button>
        </router-link>
        <mt-button v-if="more" slot="right" icon="more"></mt-button>
    </mt-header>
</div>
</template>

<script>
    export default {

        name: "myheader",
        props:{
            'title':{type:String,required:true},//required 必须传值，不传报错
            'back':{type: Boolean,default:true}, //default 默认值，不传则使用它
            'more':{type: Boolean,default:false}//type :是用来规定传递进来的数据的数据类型
        },
        methods:{
            goback(){
                this.$router.go(-1)
            }
        }
    }
</script>

<style scoped>

</style>
